/**
 * 
 */
package com.sdu.passager.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
 * @author Administrator
 *  获得配置文件中的bean
 */
public class AppConf {
	private static final String APP_LOCATION = "/conf/applicationContext.xml";

	private static ApplicationContext cTools = null;

	private static final String[] locations = { APP_LOCATION };

	//
	/**
	 * @description:获得配置文件的bean
	 * @author: leel Jul 5, 2012 8:38:22 AM
	 * 
	 * @param name
	 * @return Object
	 */
	public static Object getBean(String name) {
		if (cTools == null) {
			cTools = new ClassPathXmlApplicationContext(locations);
		}
		return cTools.getBean(name);
	}
}
